package com.iqiyi.game.ams.application;

import com.iqiyi.game.ams.domain.acitivty.entity.Activity;
import com.iqiyi.game.ams.infrastructure.repository.ActivityRepository;
import com.iqiyi.game.ams.ui.dto.ActivityDTO;
import com.iqiyi.game.ams.ui.query.ActivityQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author hanbaoyu
 */
@Component
public class ActivityAppService implements AppService {

    @Autowired
    private ActivityRepository activityRepository;

    public ActivityDTO get(ActivityQuery activityQuery) {
        Activity activity = activityRepository.of(activityQuery.getId());
        activity.getModules(activityQuery.getModule());

        return activity.convert();
    }
}
